home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #14 / Monster Media No. 14 (April 1996) (Monster Media, Inc.).ISO / os2 / fm2_240.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1996-01-21  |  47KB  |  1,155 lines

  1. /*
  2.  * FM/2 2.x installation program copyright (c) 1994/96 by M. Kimes
  3.  *
  4.  * This program creates a folder to hold program objects,
  5.  * then creates program objects for each executable.  It only needs to be
  6.  * run once (unless you move the FM/2 directory -- see say notes at end).
  7.  * Run this program in the FM/2 directory (where you unpacked the archive).
  8.  *
  9.  * For unattended installation, remove the lines marked with "NOTE:" below.
  10.  */
  11.  
  12. /* see if we might be in the right directory... */
  13.  
  14. '@Echo off'
  15. 'cls'
  16.  
  17. say'     ┌───────────────────────────────────────────────────────────────────┐'
  18. say'     │                  FM/2 2.x Installation Program                    │'
  19. say'     │             FM/2 is copyright (c) 1993-96 by M. Kimes             │'
  20. say'     │                       All rights reserved                         │'
  21. say'     ├───────────────────────────────────────────────────────────────────┤'
  22. say'     ├───────────────────────────────────────────────────────────────────┤'
  23. say'     │                Have you read the READ.ME file yet?                │'
  24. say'     │        By running this program, you agree to the license          │'
  25. say'     │                     as specified in that file,                    │'
  26. say'     │      and it tells you how to install, so you should read it.      │'
  27. say'     │                             Please?                               │'
  28. say'     └───────────────────────────────────────────────────────────────────┘'
  29.  
  30. /*
  31.  * allow user to eliminate associations from being placed on AV/2.
  32.  * seemed to upset some fellow on CIS (I guess he doesn't know about
  33.  * Settings notebooks on WPS objects).
  34.  */
  35. assocfilter = ';ASSOCFILTER=*.ZIP,*.ARC,*.LZH,*.ARJ,*.ZOO,*.MO0,READ.ME,README,README.1ST,README.OS2,REGISTER.TXT'
  36. existed = ''
  37. parse upper arg dummy
  38. if dummy = 'NOASSOC' then assocfilter = ''
  39.  
  40. rc = stream('fm3.exe','c','query exists')
  41. if rc = '' then
  42. do
  43.   say 'Sorry, FM3.EXE not found.  Must not be right directory.  Terminating.'
  44.   exit
  45. end
  46.  
  47. /* tell user what we're doing, give him a chance to hit CTRL-C */
  48.  
  49. say ''
  50. say 'This program creates objects for FM/2 and does some drudgework for you.'
  51. say ''
  52.  
  53. /* load rexx utility functions */
  54.  
  55. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  56. call SysLoadFuncs
  57.  
  58. /* NOTE:  remove following 6 lines for unattended use... */
  59. call charout ,'  Press [Enter] to continue...'
  60. dummy = ''
  61. do until dummy = '0d'x
  62.   dummy = SysGetKey('NOECHO')
  63. end
  64. call charout ,'0d1b'x'[K'
  65.  
  66. /* save current directory */
  67.  
  68. curdir = directory()
  69.  
  70. /* say it, then do it */
  71.  
  72. say "Creating File Manager/2 folder and objects..."
  73.  
  74. /* first, create FM/2 folder */
  75.  
  76. rc = stream('fm2fldr.ico','c','query exists')
  77. title = "File Manager/2"
  78. classname = 'WPFolder'
  79. location = '<WP_DESKTOP>'
  80. setup = 'OBJECTID=<FM3_Folder>;OPEN=DEFAULT'
  81. if rc \= '' then setup = setup';ICONFILE='rc
  82. result = SysCreateObject(classname,title,location,setup,f)
  83.  
  84. /* NOTE:  remove following 18 lines for unattended use... */
  85. if result = 0 then
  86. do
  87.   assocfilter = ''
  88.   existed = 'TRUE'
  89.   say ''
  90.   say 'The File Manager/2 folder already exists.'
  91.   call charout ,"Should I update the objects (it's painless)? (Y/N) "
  92.   dummy = ''
  93.   do forever
  94.     dummy = SysGetKey('NOECHO')
  95.     parse upper var dummy dummy
  96.     if dummy = '1b'x then dummy = 'N'
  97.     if dummy = '0d'x then dummy = 'Y'
  98.     if dummy = 'N' then leave
  99.     if dummy = 'Y' then leave
  100.   end
  101.   call charout ,dummy
  102.   say ''
  103.   if dummy = 'N' then exit
  104. end
  105.  
  106. /* now, create program objects in FM/2 folder */
  107.  
  108. rc = stream('fm3.exe','c','query exists')
  109. if rc \= '' then
  110. do
  111.   title = "FM/2"
  112.   classname = 'WPProgram'
  113.   location = '<FM3_Folder>'
  114.   setup = 'OBJECTID=<FM/2>;EXENAME='rc';STARTUPDIR='curdir
  115.   if existed = '' then setup = setup';PARAMETERS=%*'
  116.   call SysCreateObject classname,title,location,setup,u
  117. end
  118.  
  119. rc = stream('av2.exe','c','query exists')
  120. if rc \= '' then
  121. do
  122.   title = "Archive Viewer/2"
  123.   classname = 'WPProgram'
  124.   location = '<FM3_Folder>'
  125.   setup = 'EXENAME='rc';STARTUPDIR='curdir''assocfilter
  126.   if existed = '' then setup = setup';PARAMETERS=%*'
  127.   call SysCreateObject classname,title,location,setup,u
  128. end
  129.  
  130. rc = stream('doicon.exe','c','query exists')
  131. if rc \= '' then
  132. do
  133.   title = "SysIcon"
  134.   classname = 'WPProgram'
  135.   location = '<FM3_Folder>'
  136.   setup = 'EXENAME='rc';STARTUPDIR='curdir
  137.   if existed = '' then setup = setup';PARAMETERS=%*'
  138.   call SysCreateObject classname,title,location,setup,u
  139. end
  140.  
  141. rc = stream('eas.exe','c','query exists')
  142. if rc \= '' then
  143. do
  144.   title = "EA Viewer"
  145.   classname = 'WPProgram'
  146.   location = '<FM3_Folder>'
  147.   setup = 'EXENAME='rc';STARTUPDIR='curdir
  148.   if existed = '' then setup = setup';PARAMETERS=%*'
  149.   call SysCreateObject classname,title,location,setup,u
  150. end
  151.  
  152. rc = stream('ini.exe','c','query exists')
  153. if rc \= '' then
  154. do
  155.   if assocfilter \= '' then assocfilter = ';ASSOCFILTER=*.INI'
  156.   title = "INI Viewer"
  157.   classname = 'WPProgram'
  158.   location = '<FM3_Folder>'
  159.   setup = 'EXENAME='rc';STARTUPDIR='curdir''assocfilter
  160.   if existed = '' then setup = setup';PARAMETERS=%*'
  161.   call SysCreateObject classname,title,location,setup,u
  162. end
  163.  
  164. rc = stream('viewinfs.exe','c','query exists')
  165. if rc \= '' then
  166. do
  167.   title = "Bookshelf Viewer"
  168.   classname = 'WPProgram'
  169.   location = '<FM3_Folder>'
  170.   setup = 'EXENAME='rc';STARTUPDIR='curdir
  171.   call SysCreateObject classname,title,location,setup,u
  172.   title = "Helpfile Viewer"
  173.   classname = 'WPProgram'
  174.   location = '<FM3_Folder>'
  175.   setup = 'EXENAME='rc';PARAMETERS=DUMMY;STARTUPDIR='curdir
  176.   call SysCreateObject classname,title,location,setup,u
  177. end
  178.  
  179. rc = stream('killproc.exe','c','query exists')
  180. if rc \= '' then
  181. do
  182.   title = "Process Killer"
  183.   classname = 'WPProgram'
  184.   location = '<FM3_Folder>'
  185.   setup = 'OBJECTID=<FM/2_KILLPROC>;EXENAME='rc';PARAMETERS=%;STARTUPDIR='curdir
  186.   call SysCreateObject classname,title,location,setup,u
  187. end
  188.  
  189. rc = stream('undel.exe','c','query exists')
  190. if rc \= '' then
  191. do
  192.   title = "Undeleter"
  193.   classname = 'WPProgram'
  194.   location = '<FM3_Folder>'
  195.   setup = 'OBJECTID=<FM/2_UNDEL>;EXENAME='rc';STARTUPDIR='curdir
  196.   if existed = '' then setup = setup';PARAMETERS=%*'
  197.   call SysCreateObject classname,title,location,setup,u
  198. end
  199.  
  200. rc = stream('vtree.exe','c','query exists')
  201. if rc \= '' then
  202. do
  203.   title = "Visual Tree"
  204.   classname = 'WPProgram'
  205.   location = '<FM3_Folder>'
  206.   setup = 'OBJECTID=<FM/2_VTREE>;EXENAME='rc';STARTUPDIR='curdir
  207.   call SysCreateObject classname,title,location,setup,u
  208. end
  209.  
  210. rc = stream('vdir.exe','c','query exists')
  211. if rc \= '' then
  212. do
  213.   title = "Visual Directory"
  214.   classname = 'WPProgram'
  215.   location = '<FM3_Folder>'
  216.   setup = 'OBJECTID=<FM/2_VDIR>;EXENAME='rc';STARTUPDIR='curdir
  217.   if existed = '' then setup = setup';PARAMETERS=%*'
  218.   call SysCreateObject classname,title,location,setup,u
  219. end
  220.  
  221. rc = stream('vcollect.exe','c','query exists')
  222. if rc \= '' then
  223. do
  224.   title = "Collector"
  225.   classname = 'WPProgram'
  226.   location = '<FM3_Folder>'
  227.   setup = 'OBJECTID=<FM/2_VCOLLECT>;EXENAME='rc';STARTUPDIR='curdir
  228.   call SysCreateObject classname,title,location,setup,u
  229.   title = "Seek and scan"
  230.   classname = 'WPProgram'
  231.   location = '<FM3_Folder>'
  232.   setup = 'OBJECTID=<FM/2_VSEEK>;EXENAME='rc';PARAMETERS=**;STARTUPDIR='curdir
  233.   call SysCreateObject classname,title,location,setup,u
  234. end
  235.  
  236. rc = stream('global.exe','c','query exists')
  237. if rc \= '' then
  238. do
  239.   title = "Global File Viewer"
  240.   classname = 'WPProgram'
  241.   location = '<FM3_Folder>'
  242.   setup = 'OBJECTID=<FM/2_SEEALL>;EXENAME='rc';STARTUPDIR='curdir
  243.   call SysCreateObject classname,title,location,setup,u
  244. end
  245.  
  246. rc = stream('databar.exe','c','query exists')
  247. if rc \= '' then
  248. do
  249.   title = "Databar"
  250.   classname = 'WPProgram'
  251.   location = '<FM3_Folder>'
  252.   setup = 'OBJECTID=<FM/2_DATABAR>;EXENAME='rc';STARTUPDIR='curdir
  253.   call SysCreateObject classname,title,location,setup,u
  254. end
  255.  
  256. rc = stream('sysinfo.exe','c','query exists')
  257. if rc \= '' then
  258. do
  259.   title = "SysInfo"
  260.   classname = 'WPProgram'
  261.   location = '<FM3_Folder>'
  262.   setup = 'OBJECTID=<FM/2_SYSINFO>;EXENAME='rc';STARTUPDIR='curdir
  263.   call SysCreateObject classname,title,location,setup,u
  264. end
  265.  
  266. rc = stream('READ.ME','c','query exists')
  267. if rc \= '' then
  268. do
  269.   title = "Read.Me"
  270.   classname = 'WPShadow'
  271.   location = '<FM3_Folder>'
  272.   setup = 'SHADOWID='rc
  273.   call SysCreateObject classname,title,location,setup,u
  274. end
  275.  
  276. rc = stream('HISTORY.TXT','c','query exists')
  277. if rc \= '' then
  278. do
  279.   title = "History.Txt"
  280.   classname = 'WPShadow'
  281.   location = '<FM3_Folder>'
  282.   setup = 'SHADOWID='rc
  283.   call SysCreateObject classname,title,location,setup,u
  284. end
  285.  
  286. rc = stream('REGISTER.TXT','c','query exists')
  287. if rc \= '' then
  288. do
  289.   title = "Register.Txt"
  290.   classname = 'WPShadow'
  291.   location = '<FM3_Folder>'
  292.   setup = 'SHADOWID='rc
  293.   call SysCreateObject classname,title,location,setup,u
  294. end
  295.  
  296. rc = stream('ASSOCIAT.TXT','c','query exists')
  297. if rc \= '' then
  298. do
  299.   title = "Associat.Txt"
  300.   classname = 'WPShadow'
  301.   location = '<FM3_Folder>'
  302.   setup = 'SHADOWID='rc
  303.   call SysCreateObject classname,title,location,setup,u
  304. end
  305.  
  306. rc = stream('FM3.HLP','c','query exists')
  307. if rc \= '' then
  308. do
  309.   if assocfilter \= '' then assocfilter=';ASSOCFILTER=*.HLP'
  310.   rc = stream('SEEHELP.EXE','c','query exists')
  311.   if rc \= '' then
  312.   do
  313.     title = "FM/2 Online Help"
  314.     classname = 'WPProgram'
  315.     location = '<FM3_Folder>'
  316.     setup = 'EXENAME='rc';STARTUPDIR='curdir';PARAMETERS= %* 'curdir'\FM3.HLP'
  317.     call SysCreateObject classname,title,location,setup,u
  318.   end
  319. end
  320.  
  321. rc = stream('UTILS\FATOPT.EXE','c','query exists')
  322. if rc \= '' then
  323. do
  324.   title = "FAT Optimizer"
  325.   classname = 'WPProgram'
  326.   location = '<FM3_Folder>'
  327.   setup = 'EXENAME='rc';STARTUPDIR='curdir'\UTILS;PARAMETERS=[Drive letter] [-Options]'
  328.   call SysCreateObject classname,title,location,setup,u
  329. end
  330.  
  331. rc = stream('UTILS\HPFSOPT.EXE','c','query exists')
  332. if rc \= '' then
  333. do
  334.   title = "HPFS Optimizer"
  335.   classname = 'WPProgram'
  336.   location = '<FM3_Folder>'
  337.   setup = 'EXENAME='rc';STARTUPDIR='curdir'\UTILS;PARAMETERS=[Drive:\Path] [-Options]'
  338.   call SysCreateObject classname,title,location,setup,u
  339. end
  340.  
  341. rc = stream('UTILS\MAKEOBJ.CMD','c','query exists')
  342. if rc \= '' then
  343. do
  344.   title = "Make Object"
  345.   classname = 'WPProgram'
  346.   location = '<FM3_Folder>'
  347.   setup = 'EXENAME='rc';STARTUPDIR='curdir'\UTILS;PARAMETERS=%*'
  348.   call SysCreateObject classname,title,location,setup,u
  349. end
  350.  
  351. /* create sample customizations for the user so they don't start 'blank' */
  352.  
  353. rc = stream('FM3MENU.DAT','c','query exists')
  354. if rc = '' then
  355. do
  356.   rc = stream('FM2MENU.TMP','c','query exists')
  357.   if rc \= '' then
  358.   do
  359.     say 'Creating a sample FM3MENU.DAT file for you.'
  360.     'REN FM3MENU.TMP FM3MENU.DAT 1>NUL 2>NUL'
  361.   end
  362. end
  363. 'DEL FM3MENU.TMP 1>NUL 2>NUL'
  364. rc = stream('ASSOC.DAT','c','query exists')
  365. if rc = '' then
  366. do
  367.   rc = stream('ASSOC.TMP','c','query exists')
  368.   if rc \= '' then
  369.   do
  370.     say 'Creating a sample ASSOC.DAT file for you.'
  371.     'REN ASSOC.TMP ASSOC.DAT 1>NUL 2>NUL'
  372.   end
  373. end
  374. 'DEL ASSOC.TMP 1>NUL 2>NUL'
  375. rc = stream('COMMANDS.DAT','c','query exists')
  376. if rc = '' then
  377. do
  378.   rc = stream('COMMANDS.TMP','c','query exists')
  379.   if rc \= '' then
  380.   do
  381.     say 'Creating a sample COMMANDS.DAT file for you.'
  382.     'REN COMMANDS.TMP COMMANDS.DAT 1>NUL 2>NUL'
  383.   end
  384. end
  385. 'DEL COMMANDS.TMP 1>NUL 2>NUL'
  386. rc = stream('FILTERS.DAT','c','query exists')
  387. if rc = '' then
  388. do
  389.   rc = stream('FILTERS.TMP','c','query exists')
  390.   if rc \= '' then
  391.   do
  392.     say 'Creating a sample FILTERS.DAT file for you.'
  393.     'REN FILTERS.TMP FILTERS.DAT 1>NUL 2>NUL'
  394.   end
  395. end
  396. 'DEL FILTERS.TMP 1>NUL 2>NUL'
  397. rc = stream('FM3TOOLS.DAT','c','query exists')
  398. if rc = '' then
  399. do
  400.   rc = stream('FM3TOOLS.TMP','c','query exists')
  401.   if rc \= '' then
  402.   do
  403.     say 'Creating a sample FM3TOOLS.DAT file for you.'
  404.     'REN FM3TOOLS.TMP FM3TOOLS.DAT 1>NUL 2>NUL'
  405.   end
  406. end
  407. 'DEL FM3TOOLS.TMP 1>NUL 2>NUL'
  408. rc = stream('QUICKTLS.DAT','c','query exists')
  409. if rc = '' then
  410. do
  411.   rc = stream('QUICKTLS.TMP','c','query exists')
  412.   if rc \= '' then
  413.   do
  414.     rc = stream('CMDS.TMP','c','query exists')
  415.     if rc \= '' then
  416.     do
  417.       rc = stream('UTILS.TMP','c','query exists')
  418.       if rc \= '' then
  419.       do
  420.         rc = stream('SORT.TMP','c','query exists')
  421.         if rc \= '' then
  422.         do
  423.           rc = stream('SELECT.TMP','c','query exists')
  424.           if rc \= '' then
  425.           do
  426.             say 'Creating a sample QUICKTLS.DAT file and toolboxes for you.'
  427.             'REN QUICKTLS.TMP QUICKTLS.DAT 1>NUL 2>NUL'
  428.             'REN CMDS.TMP CMDS.TLS 1>NUL 2>NUL'
  429.             'REN UTILS.TMP UTILS.TLS 1>NUL 2>NUL'
  430.             'REN SORT.TMP SORT.TLS 1>NUL 2>NUL'
  431.             'REN SELECT.TMP SELECT.TLS 1>NUL 2>NUL'
  432.           end
  433.           'DEL SELECT.TMP 1>NUL 2>NUL'
  434.         end
  435.        'DEL SORT.TMP 1>NUL 2>NUL'
  436.       end
  437.       'DEL UTILS.TMP 1>NUL 2>NUL'
  438.     end
  439.     'DEL CMDS.TMP 1>NUL 2>NUL'
  440.   end
  441. end
  442. 'DEL QUICKTLS.TMP 1>NUL 2>NUL'
  443.  
  444. /*
  445.  * create command files that the user can execute from anywhere (we'll
  446.  * ask the user to put this utils directory on the PATH) and that other
  447.  * programs can execute to use FM/2 as "their" file manager.
  448.  */
  449.  
  450. 'del SETENV.CMD 1>NUL 2>NUL'
  451. dummy = stream('SETENV.CMD','C','open')
  452. if dummy = 'READY:' then
  453. do
  454.   call lineout 'SETENV.CMD','@ECHO OFF'
  455.   call lineout 'SETENV.CMD','REM'
  456.   call lineout 'SETENV.CMD','REM If you prefer, you can call this .CMD file'
  457.   call lineout 'SETENV.CMD','REM instead of altering the PATH= statement in'
  458.   call lineout 'SETENV.CMD','REM CONFIG.SYS to gain access to the FM/2'
  459.   call lineout 'SETENV.CMD','REM command line utilities.'
  460.   call lineout 'SETENV.CMD','REM'
  461.   call lineout 'SETENV.CMD','IF "%FM2ENVSET%" == "" GOTO INSTALL'
  462.   call lineout 'SETENV.CMD','GOTO SKIP'
  463.   call lineout 'SETENV.CMD',':INSTALL'
  464.   call lineout 'SETENV.CMD','SET FM2ENVSET=YES'
  465.   call lineout 'SETENV.CMD','SET PATH=%PATH%;'curdir'\utils;'
  466.   call lineout 'SETENV.CMD','ECHO Path set for FM/2 and utilities.'
  467.   call lineout 'SETENV.CMD','GOTO END'
  468.   call lineout 'SETENV.CMD',':SKIP'
  469.   call lineout 'SETENV.CMD','ECHO Paths already set for FM/2 and utilities.'
  470.   call lineout 'SETENV.CMD',':END'
  471.   call stream 'SETENV.CMD','C','close'
  472. end
  473.  
  474. /*
  475.  * place an object for SETENV.CMD in folder so user doesn't have to diddle
  476.  * their PATH statement if they don't want to for command line work.
  477.  */
  478.  
  479.  
  480. rc = stream('SETENV.CMD','c','query exists')
  481. if rc \= '' then
  482. do
  483.   title = "Utility command line"
  484.   classname = 'WPProgram'
  485.   location = '<FM3_Folder>'
  486.   setup = 'EXENAME=*;PARAMETERS=/K 'rc';STARTUPDIR=C:\'
  487.   call SysCreateObject classname,title,location,setup,u
  488. end
  489.  
  490. call SysMkDir curdir'\UTILS'
  491. dummy = directory(curdir'\UTILS')
  492. if dummy = curdir'\UTILS' then
  493. do
  494.   'set PATH=%PATH%;'curdir'\utils'
  495.   'move ..\example.cmd 1>NUL 2>NUL'
  496.   'del FM2.CMD 1>NUL 2>NUL'
  497.   dummy = stream('FM2.CMD','C','open')
  498.   if dummy = 'READY:' then
  499.   do
  500.     say 'Creating an FM2.CMD file.'
  501.     call lineout 'FM2.CMD', "/* FM/2 command file.  Locate in a directory"
  502.     call lineout 'FM2.CMD', " * on your PATH. */"
  503.     call lineout 'FM2.CMD', "'@echo off'"
  504.       call lineout 'FM2.CMD', "mydir = directory()"
  505.       call lineout 'FM2.CMD', "arg arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  506.       call lineout 'FM2.CMD', "if arg1 \= '' then "
  507.       call lineout 'FM2.CMD', "do"
  508.       call lineout 'FM2.CMD', "  if left(arg1,1,1) \= '/' then"
  509.       call lineout 'FM2.CMD', "  do"
  510.       call lineout 'FM2.CMD', "    arg0 = arg1"
  511.       call lineout 'FM2.CMD', "    arg1 = stream(arg1,'c','query exists')"
  512.       call lineout 'FM2.CMD', "    if arg1 = '' then"
  513.       call lineout 'FM2.CMD', "    do"
  514.       call lineout 'FM2.CMD', "      arg1 = directory(arg0)"
  515.       call lineout 'FM2.CMD', "      call directory mydir"
  516.       call lineout 'FM2.CMD', "    end"
  517.       call lineout 'FM2.CMD', "  end"
  518.       call lineout 'FM2.CMD', "end"
  519.       call lineout 'FM2.CMD', "else arg1 = mydir"
  520.       call lineout 'FM2.CMD', "if arg2 \= '' then "
  521.       call lineout 'FM2.CMD', "do"
  522.       call lineout 'FM2.CMD', "  if left(arg2,1,1) \= '/' then"
  523.       call lineout 'FM2.CMD', "  do"
  524.       call lineout 'FM2.CMD', "    arg0 = arg2"
  525.       call lineout 'FM2.CMD', "    arg2 = stream(arg2,'c','query exists')"
  526.       call lineout 'FM2.CMD', "    if arg2 = '' then"
  527.       call lineout 'FM2.CMD', "    do"
  528.       call lineout 'FM2.CMD', "      arg2 = directory(arg0)"
  529.       call lineout 'FM2.CMD', "      call directory mydir"
  530.       call lineout 'FM2.CMD', "    end"
  531.       call lineout 'FM2.CMD', "  end"
  532.       call lineout 'FM2.CMD', "end"
  533.       call lineout 'FM2.CMD', "if arg3 \= '' then "
  534.       call lineout 'FM2.CMD', "do"
  535.       call lineout 'FM2.CMD', "  if left(arg3,1,1) \= '/' then"
  536.       call lineout 'FM2.CMD', "  do"
  537.       call lineout 'FM2.CMD', "    arg0 = arg3"
  538.       call lineout 'FM2.CMD', "    arg3 = stream(arg3,'c','query exists')"
  539.       call lineout 'FM2.CMD', "    if arg3 = '' then"
  540.       call lineout 'FM2.CMD', "    do"
  541.       call lineout 'FM2.CMD', "      arg3 = directory(arg0)"
  542.       call lineout 'FM2.CMD', "      call directory mydir"
  543.       call lineout 'FM2.CMD', "    end"
  544.       call lineout 'FM2.CMD', "  end"
  545.       call lineout 'FM2.CMD', "end"
  546.       call lineout 'FM2.CMD', "if arg4 \= '' then "
  547.       call lineout 'FM2.CMD', "do"
  548.       call lineout 'FM2.CMD', "  if left(arg4,1,1) \= '/' then"
  549.       call lineout 'FM2.CMD', "  do"
  550.       call lineout 'FM2.CMD', "    arg0 = arg4"
  551.       call lineout 'FM2.CMD', "    arg4 = stream(arg4,'c','query exists')"
  552.       call lineout 'FM2.CMD', "    if arg4 = '' then"
  553.       call lineout 'FM2.CMD', "    do"
  554.       call lineout 'FM2.CMD', "      arg4 = directory(arg0)"
  555.       call lineout 'FM2.CMD', "      call directory mydir"
  556.       call lineout 'FM2.CMD', "    end"
  557.       call lineout 'FM2.CMD', "  end"
  558.       call lineout 'FM2.CMD', "end"
  559.       call lineout 'FM2.CMD', "if arg5 \= '' then "
  560.       call lineout 'FM2.CMD', "do"
  561.       call lineout 'FM2.CMD', "  if left(arg5,1,1) \= '/' then"
  562.       call lineout 'FM2.CMD', "  do"
  563.       call lineout 'FM2.CMD', "    arg0 = arg5"
  564.       call lineout 'FM2.CMD', "    arg5 = stream(arg5,'c','query exists')"
  565.       call lineout 'FM2.CMD', "    if arg5 = '' then"
  566.       call lineout 'FM2.CMD', "    do"
  567.       call lineout 'FM2.CMD', "      arg5 = directory(arg0)"
  568.       call lineout 'FM2.CMD', "      call directory mydir"
  569.       call lineout 'FM2.CMD', "    end"
  570.       call lineout 'FM2.CMD', "  end"
  571.       call lineout 'FM2.CMD', "end"
  572.       call lineout 'FM2.CMD', "if arg6 \= '' then "
  573.       call lineout 'FM2.CMD', "do"
  574.       call lineout 'FM2.CMD', "  if left(arg6,1,1) \= '/' then"
  575.       call lineout 'FM2.CMD', "  do"
  576.       call lineout 'FM2.CMD', "    arg0 = arg6"
  577.       call lineout 'FM2.CMD', "    arg6 = stream(arg6,'c','query exists')"
  578.       call lineout 'FM2.CMD', "    if arg6 = '' then"
  579.       call lineout 'FM2.CMD', "    do"
  580.       call lineout 'FM2.CMD', "      arg6 = directory(arg0)"
  581.       call lineout 'FM2.CMD', "      call directory mydir"
  582.       call lineout 'FM2.CMD', "    end"
  583.       call lineout 'FM2.CMD', "  end"
  584.       call lineout 'FM2.CMD', "end"
  585.       call lineout 'FM2.CMD', "if arg7 \= '' then "
  586.       call lineout 'FM2.CMD', "do"
  587.       call lineout 'FM2.CMD', "  if left(arg7,1,1) \= '/' then"
  588.       call lineout 'FM2.CMD', "  do"
  589.       call lineout 'FM2.CMD', "    arg0 = arg7"
  590.       call lineout 'FM2.CMD', "    arg7 = stream(arg7,'c','query exists')"
  591.       call lineout 'FM2.CMD', "    if arg7 = '' then"
  592.       call lineout 'FM2.CMD', "    do"
  593.       call lineout 'FM2.CMD', "      arg7 = directory(arg0)"
  594.       call lineout 'FM2.CMD', "      call directory mydir"
  595.       call lineout 'FM2.CMD', "    end"
  596.       call lineout 'FM2.CMD', "  end"
  597.       call lineout 'FM2.CMD', "end"
  598.       call lineout 'FM2.CMD', "if arg8 \= '' then "
  599.       call lineout 'FM2.CMD', "do"
  600.       call lineout 'FM2.CMD', "  if left(arg8,1,1) \= '/' then"
  601.       call lineout 'FM2.CMD', "  do"
  602.       call lineout 'FM2.CMD', "    arg0 = arg8"
  603.       call lineout 'FM2.CMD', "    arg8 = stream(arg8,'c','query exists')"
  604.       call lineout 'FM2.CMD', "    if arg8 = '' then"
  605.       call lineout 'FM2.CMD', "    do"
  606.       call lineout 'FM2.CMD', "      arg8 = directory(arg0)"
  607.       call lineout 'FM2.CMD', "      call directory mydir"
  608.       call lineout 'FM2.CMD', "    end"
  609.       call lineout 'FM2.CMD', "  end"
  610.       call lineout 'FM2.CMD', "end"
  611.       call lineout 'FM2.CMD', "if arg9 \= '' then "
  612.       call lineout 'FM2.CMD', "do"
  613.       call lineout 'FM2.CMD', "  if left(arg9,1,1) \= '/' then"
  614.       call lineout 'FM2.CMD', "  do"
  615.       call lineout 'FM2.CMD', "    arg0 = arg9"
  616.       call lineout 'FM2.CMD', "    arg9 = stream(arg9,'c','query exists')"
  617.       call lineout 'FM2.CMD', "    if arg9 = '' then"
  618.       call lineout 'FM2.CMD', "    do"
  619.       call lineout 'FM2.CMD', "      arg9 = directory(arg0)"
  620.       call lineout 'FM2.CMD', "      call directory mydir"
  621.       call lineout 'FM2.CMD', "    end"
  622.       call lineout 'FM2.CMD', "  end"
  623.       call lineout 'FM2.CMD', "end"
  624.     call lineout 'FM2.CMD', "n = setlocal()"
  625.     call lineout 'FM2.CMD', "n = directory('"curdir"')"
  626.     call lineout 'FM2.CMD', "'start fm3.exe 'arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  627.     call lineout 'FM2.CMD', "n = endlocal()"
  628.     call stream 'FM2.CMD','C','close'
  629.     'del AV2.CMD 1>NUL 2>NUL'
  630.     dummy = stream('AV2.CMD','C','open')
  631.     if dummy = 'READY:' then
  632.     do
  633.       say 'Creating an AV2.CMD file.'
  634.       call lineout 'AV2.CMD', "/* AV/2 command file.  Locate in a directory"
  635.       call lineout 'AV2.CMD', " * on your PATH. */"
  636.       call lineout 'AV2.CMD', "'@echo off'"
  637.       call lineout 'AV2.CMD', "arg arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  638.       call lineout 'AV2.CMD', "if arg1 \= '' then "
  639.       call lineout 'AV2.CMD', "do"
  640.       call lineout 'AV2.CMD', "  if left(arg1,1,1) \= '/' then"
  641.       call lineout 'AV2.CMD', "  do"
  642.       call lineout 'AV2.CMD', "    arg1 = stream(arg1,'c','query exists')"
  643.       call lineout 'AV2.CMD', "  end"
  644.       call lineout 'AV2.CMD', "end"
  645.       call lineout 'AV2.CMD', "else arg1 = directory()"
  646.       call lineout 'AV2.CMD', "if arg2 \= '' then "
  647.       call lineout 'AV2.CMD', "do"
  648.       call lineout 'AV2.CMD', "  if left(arg2,1,1) \= '/' then"
  649.       call lineout 'AV2.CMD', "  do"
  650.       call lineout 'AV2.CMD', "    arg2 = stream(arg2,'c','query exists')"
  651.       call lineout 'AV2.CMD', "  end"
  652.       call lineout 'AV2.CMD', "end"
  653.       call lineout 'AV2.CMD', "if arg3 \= '' then "
  654.       call lineout 'AV2.CMD', "do"
  655.       call lineout 'AV2.CMD', "  if left(arg3,1,1) \= '/' then"
  656.       call lineout 'AV2.CMD', "  do"
  657.       call lineout 'AV2.CMD', "    arg3 = stream(arg3,'c','query exists')"
  658.       call lineout 'AV2.CMD', "  end"
  659.       call lineout 'AV2.CMD', "end"
  660.       call lineout 'AV2.CMD', "if arg4 \= '' then "
  661.       call lineout 'AV2.CMD', "do"
  662.       call lineout 'AV2.CMD', "  if left(arg4,1,1) \= '/' then"
  663.       call lineout 'AV2.CMD', "  do"
  664.       call lineout 'AV2.CMD', "    arg4 = stream(arg4,'c','query exists')"
  665.       call lineout 'AV2.CMD', "  end"
  666.       call lineout 'AV2.CMD', "end"
  667.       call lineout 'AV2.CMD', "if arg5 \= '' then "
  668.       call lineout 'AV2.CMD', "do"
  669.       call lineout 'AV2.CMD', "  if left(arg5,1,1) \= '/' then"
  670.       call lineout 'AV2.CMD', "  do"
  671.       call lineout 'AV2.CMD', "    arg5 = stream(arg5,'c','query exists')"
  672.       call lineout 'AV2.CMD', "  end"
  673.       call lineout 'AV2.CMD', "end"
  674.       call lineout 'AV2.CMD', "if arg6 \= '' then "
  675.       call lineout 'AV2.CMD', "do"
  676.       call lineout 'AV2.CMD', "  if left(arg6,1,1) \= '/' then"
  677.       call lineout 'AV2.CMD', "  do"
  678.       call lineout 'AV2.CMD', "    arg6 = stream(arg6,'c','query exists')"
  679.       call lineout 'AV2.CMD', "  end"
  680.       call lineout 'AV2.CMD', "end"
  681.       call lineout 'AV2.CMD', "if arg7 \= '' then "
  682.       call lineout 'AV2.CMD', "do"
  683.       call lineout 'AV2.CMD', "  if left(arg7,1,1) \= '/' then"
  684.       call lineout 'AV2.CMD', "  do"
  685.       call lineout 'AV2.CMD', "    arg7 = stream(arg7,'c','query exists')"
  686.       call lineout 'AV2.CMD', "  end"
  687.       call lineout 'AV2.CMD', "end"
  688.       call lineout 'AV2.CMD', "if arg8 \= '' then "
  689.       call lineout 'AV2.CMD', "do"
  690.       call lineout 'AV2.CMD', "  if left(arg8,1,1) \= '/' then"
  691.       call lineout 'AV2.CMD', "  do"
  692.       call lineout 'AV2.CMD', "    arg8 = stream(arg8,'c','query exists')"
  693.       call lineout 'AV2.CMD', "  end"
  694.       call lineout 'AV2.CMD', "end"
  695.       call lineout 'AV2.CMD', "if arg9 \= '' then "
  696.       call lineout 'AV2.CMD', "do"
  697.       call lineout 'AV2.CMD', "  if left(arg9,1,1) \= '/' then"
  698.       call lineout 'AV2.CMD', "  do"
  699.       call lineout 'AV2.CMD', "    arg9 = stream(arg9,'c','query exists')"
  700.       call lineout 'AV2.CMD', "  end"
  701.       call lineout 'AV2.CMD', "end"
  702.       call lineout 'AV2.CMD', "n = setlocal()"
  703.       call lineout 'AV2.CMD', "n = directory('"curdir"')"
  704.       call lineout 'AV2.CMD', "'start av2.exe 'arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  705.       call lineout 'AV2.CMD', "n = endlocal()"
  706.       call stream 'AV2.CMD','C','close'
  707.     end
  708.     else say "Couldn't create AV2.CMD file."
  709.     'del VDIR.CMD 1>NUL 2>NUL'
  710.     dummy = stream('VDIR.CMD','C','open')
  711.     if dummy = 'READY:' then
  712.     do
  713.       say 'Creating a VDIR.CMD file.'
  714.       call lineout 'VDIR.CMD', "/* VDIR (FM/2) command file.  Locate in a directory"
  715.       call lineout 'VDIR.CMD', " * on your PATH. */"
  716.       call lineout 'VDIR.CMD', "'@echo off'"
  717.       call lineout 'VDIR.CMD', "mydir = directory()"
  718.       call lineout 'VDIR.CMD', "arg arg1 arg2"
  719.       call lineout 'VDIR.CMD', "if arg1 \= '' then "
  720.       call lineout 'VDIR.CMD', "do"
  721.       call lineout 'VDIR.CMD', "  if left(arg1,1,1) \= '/' then"
  722.       call lineout 'VDIR.CMD', "  do"
  723.       call lineout 'VDIR.CMD', "    arg0 = arg1"
  724.       call lineout 'VDIR.CMD', "    arg1 = stream(arg1,'c','query exists')"
  725.       call lineout 'VDIR.CMD', "    if arg1 = '' then"
  726.       call lineout 'VDIR.CMD', "    do"
  727.       call lineout 'VDIR.CMD', "      arg1 = directory(arg0)"
  728.       call lineout 'VDIR.CMD', "      call directory mydir"
  729.       call lineout 'VDIR.CMD', "    end"
  730.       call lineout 'VDIR.CMD', "  end"
  731.       call lineout 'VDIR.CMD', "end"
  732.       call lineout 'VDIR.CMD', "else arg1 = mydir"
  733.       call lineout 'VDIR.CMD', "n = setlocal()"
  734.       call lineout 'VDIR.CMD', "n = directory('"curdir"')"
  735.       call lineout 'VDIR.CMD', "'start vdir.exe 'arg1 '%2 %3 %4 %5 %6 %7 %8 %9"
  736.       call lineout 'VDIR.CMD', "n = endlocal()"
  737.       call stream 'VDIR.CMD','C','close'
  738.     end
  739.     else say "Couldn't create VDIR.CMD file."
  740.     'del VTREE.CMD 1>NUL 2>NUL'
  741.     dummy = stream('VTREE.CMD','C','open')
  742.     if dummy = 'READY:' then
  743.     do
  744.       say 'Creating a VTREE.CMD file.'
  745.       call lineout 'VTREE.CMD', "/* VTREE (FM/2) command file.  Locate in a directory"
  746.       call lineout 'VTREE.CMD', " * on your PATH. */"
  747.       call lineout 'VTREE.CMD', "'@echo off'"
  748.       call lineout 'VTREE.CMD', "n = setlocal()"
  749.       call lineout 'VTREE.CMD', "n = directory('"curdir"')"
  750.       call lineout 'VTREE.CMD', "'start vtree.exe %1 %2 %3 %4 %5 %6 %7 %8 %9'"
  751.       call lineout 'VTREE.CMD', "n = endlocal()"
  752.       call stream 'VTREE.CMD','C','close'
  753.     end
  754.     else say "Couldn't create VTREE.CMD file."
  755.     'del VCOLLECT.CMD 1>NUL 2>NUL'
  756.     dummy = stream('VCOLLECT.CMD','C','open')
  757.     if dummy = 'READY:' then
  758.     do
  759.       say 'Creating a VCOLLECT.CMD file.'
  760.       call lineout 'VCOLLECT.CMD', "/* VCOLLECT (FM/2) command file.  Locate in a directory"
  761.       call lineout 'VCOLLECT.CMD', " * on your PATH. */"
  762.       call lineout 'VCOLLECT.CMD', "'@echo off'"
  763.       call lineout 'VCOLLECT.CMD', "arg arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  764.       call lineout 'VCOLLECT.CMD', "if arg1 \= '' then "
  765.       call lineout 'VCOLLECT.CMD', "do"
  766.       call lineout 'VCOLLECT.CMD', "  if left(arg1,1,1) \= '/' then"
  767.       call lineout 'VCOLLECT.CMD', "  do"
  768.       call lineout 'VCOLLECT.CMD', "    arg1 = stream(arg1,'c','query exists')"
  769.       call lineout 'VCOLLECT.CMD', "  end"
  770.       call lineout 'VCOLLECT.CMD', "end"
  771.       call lineout 'VCOLLECT.CMD', "if arg2 \= '' then "
  772.       call lineout 'VCOLLECT.CMD', "do"
  773.       call lineout 'VCOLLECT.CMD', "  if left(arg2,1,1) \= '/' then"
  774.       call lineout 'VCOLLECT.CMD', "  do"
  775.       call lineout 'VCOLLECT.CMD', "    arg2 = stream(arg2,'c','query exists')"
  776.       call lineout 'VCOLLECT.CMD', "  end"
  777.       call lineout 'VCOLLECT.CMD', "end"
  778.       call lineout 'VCOLLECT.CMD', "if arg3 \= '' then "
  779.       call lineout 'VCOLLECT.CMD', "do"
  780.       call lineout 'VCOLLECT.CMD', "  if left(arg3,1,1) \= '/' then"
  781.       call lineout 'VCOLLECT.CMD', "  do"
  782.       call lineout 'VCOLLECT.CMD', "    arg3 = stream(arg3,'c','query exists')"
  783.       call lineout 'VCOLLECT.CMD', "  end"
  784.       call lineout 'VCOLLECT.CMD', "end"
  785.       call lineout 'VCOLLECT.CMD', "if arg4 \= '' then "
  786.       call lineout 'VCOLLECT.CMD', "do"
  787.       call lineout 'VCOLLECT.CMD', "  if left(arg4,1,1) \= '/' then"
  788.       call lineout 'VCOLLECT.CMD', "  do"
  789.       call lineout 'VCOLLECT.CMD', "    arg4 = stream(arg4,'c','query exists')"
  790.       call lineout 'VCOLLECT.CMD', "  end"
  791.       call lineout 'VCOLLECT.CMD', "end"
  792.       call lineout 'VCOLLECT.CMD', "if arg5 \= '' then "
  793.       call lineout 'VCOLLECT.CMD', "do"
  794.       call lineout 'VCOLLECT.CMD', "  if left(arg5,1,1) \= '/' then"
  795.       call lineout 'VCOLLECT.CMD', "  do"
  796.       call lineout 'VCOLLECT.CMD', "    arg5 = stream(arg5,'c','query exists')"
  797.       call lineout 'VCOLLECT.CMD', "  end"
  798.       call lineout 'VCOLLECT.CMD', "end"
  799.       call lineout 'VCOLLECT.CMD', "if arg6 \= '' then "
  800.       call lineout 'VCOLLECT.CMD', "do"
  801.       call lineout 'VCOLLECT.CMD', "  if left(arg6,1,1) \= '/' then"
  802.       call lineout 'VCOLLECT.CMD', "  do"
  803.       call lineout 'VCOLLECT.CMD', "    arg6 = stream(arg6,'c','query exists')"
  804.       call lineout 'VCOLLECT.CMD', "  end"
  805.       call lineout 'VCOLLECT.CMD', "end"
  806.       call lineout 'VCOLLECT.CMD', "if arg7 \= '' then "
  807.       call lineout 'VCOLLECT.CMD', "do"
  808.       call lineout 'VCOLLECT.CMD', "  if left(arg7,1,1) \= '/' then"
  809.       call lineout 'VCOLLECT.CMD', "  do"
  810.       call lineout 'VCOLLECT.CMD', "    arg7 = stream(arg7,'c','query exists')"
  811.       call lineout 'VCOLLECT.CMD', "  end"
  812.       call lineout 'VCOLLECT.CMD', "end"
  813.       call lineout 'VCOLLECT.CMD', "if arg8 \= '' then "
  814.       call lineout 'VCOLLECT.CMD', "do"
  815.       call lineout 'VCOLLECT.CMD', "  if left(arg8,1,1) \= '/' then"
  816.       call lineout 'VCOLLECT.CMD', "  do"
  817.       call lineout 'VCOLLECT.CMD', "    arg8 = stream(arg8,'c','query exists')"
  818.       call lineout 'VCOLLECT.CMD', "  end"
  819.       call lineout 'VCOLLECT.CMD', "end"
  820.       call lineout 'VCOLLECT.CMD', "if arg9 \= '' then "
  821.       call lineout 'VCOLLECT.CMD', "do"
  822.       call lineout 'VCOLLECT.CMD', "  if left(arg9,1,1) \= '/' then"
  823.       call lineout 'VCOLLECT.CMD', "  do"
  824.       call lineout 'VCOLLECT.CMD', "    arg9 = stream(arg9,'c','query exists')"
  825.       call lineout 'VCOLLECT.CMD', "  end"
  826.       call lineout 'VCOLLECT.CMD', "end"
  827.       call lineout 'VCOLLECT.CMD', "n = setlocal()"
  828.       call lineout 'VCOLLECT.CMD', "n = directory('"curdir"')"
  829.       call lineout 'VCOLLECT.CMD', "'start vcollect.exe 'arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  830.       call lineout 'VCOLLECT.CMD', "n = endlocal()"
  831.       call stream 'VCOLLECT.CMD','C','close'
  832.     end
  833.     else say "Couldn't create VCOLLECT.CMD file."
  834.     'del INI.CMD 1>NUL 2>NUL'
  835.     dummy = stream('INI.CMD','C','open')
  836.     if dummy = 'READY:' then
  837.     do
  838.       say 'Creating an INI.CMD file.'
  839.       call lineout 'INI.CMD', "/* INI (FM/2) command file.  Locate in a directory"
  840.       call lineout 'INI.CMD', " * on your PATH. */"
  841.       call lineout 'INI.CMD', "'@echo off'"
  842.       call lineout 'INI.CMD', "arg arg1"
  843.       call lineout 'INI.CMD', "if arg1 \= '' then arg1 = stream(arg1,'c','query exists')"
  844.       call lineout 'INI.CMD', "n = setlocal()"
  845.       call lineout 'INI.CMD', "n = directory('"curdir"')"
  846.       call lineout 'INI.CMD', "'start INI.exe 'arg1"
  847.       call lineout 'INI.CMD', "n = endlocal()"
  848.       call stream 'INI.CMD','C','close'
  849.     end
  850.     else say "Couldn't create INI.CMD file."
  851.     'del EAS.CMD 1>NUL 2>NUL'
  852.     dummy = stream('EAS.CMD','C','open')
  853.     if dummy = 'READY:' then
  854.     do
  855.       say 'Creating an EAS.CMD file.'
  856.       call lineout 'EAS.CMD', "/* EAS (FM/2) command file.  Locate in a directory"
  857.       call lineout 'EAS.CMD', " * on your PATH. */"
  858.       call lineout 'EAS.CMD', "'@echo off'"
  859.       call lineout 'EAS.CMD', "arg arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  860.       call lineout 'EAS.CMD', "if arg1 \= '' then "
  861.       call lineout 'EAS.CMD', "do"
  862.       call lineout 'EAS.CMD', "  if left(arg1,1,1) \= '/' then"
  863.       call lineout 'EAS.CMD', "  do"
  864.       call lineout 'EAS.CMD', "    arg1 = stream(arg1,'c','query exists')"
  865.       call lineout 'EAS.CMD', "  end"
  866.       call lineout 'EAS.CMD', "end"
  867.       call lineout 'EAS.CMD', "else arg1 = directory()"
  868.       call lineout 'EAS.CMD', "if arg2 \= '' then "
  869.       call lineout 'EAS.CMD', "do"
  870.       call lineout 'EAS.CMD', "  if left(arg2,1,1) \= '/' then"
  871.       call lineout 'EAS.CMD', "  do"
  872.       call lineout 'EAS.CMD', "    arg2 = stream(arg2,'c','query exists')"
  873.       call lineout 'EAS.CMD', "  end"
  874.       call lineout 'EAS.CMD', "end"
  875.       call lineout 'EAS.CMD', "if arg3 \= '' then "
  876.       call lineout 'EAS.CMD', "do"
  877.       call lineout 'EAS.CMD', "  if left(arg3,1,1) \= '/' then"
  878.       call lineout 'EAS.CMD', "  do"
  879.       call lineout 'EAS.CMD', "    arg3 = stream(arg3,'c','query exists')"
  880.       call lineout 'EAS.CMD', "  end"
  881.       call lineout 'EAS.CMD', "end"
  882.       call lineout 'EAS.CMD', "if arg4 \= '' then "
  883.       call lineout 'EAS.CMD', "do"
  884.       call lineout 'EAS.CMD', "  if left(arg4,1,1) \= '/' then"
  885.       call lineout 'EAS.CMD', "  do"
  886.       call lineout 'EAS.CMD', "    arg4 = stream(arg4,'c','query exists')"
  887.       call lineout 'EAS.CMD', "  end"
  888.       call lineout 'EAS.CMD', "end"
  889.       call lineout 'EAS.CMD', "if arg5 \= '' then "
  890.       call lineout 'EAS.CMD', "do"
  891.       call lineout 'EAS.CMD', "  if left(arg5,1,1) \= '/' then"
  892.       call lineout 'EAS.CMD', "  do"
  893.       call lineout 'EAS.CMD', "    arg5 = stream(arg5,'c','query exists')"
  894.       call lineout 'EAS.CMD', "  end"
  895.       call lineout 'EAS.CMD', "end"
  896.       call lineout 'EAS.CMD', "if arg6 \= '' then "
  897.       call lineout 'EAS.CMD', "do"
  898.       call lineout 'EAS.CMD', "  if left(arg6,1,1) \= '/' then"
  899.       call lineout 'EAS.CMD', "  do"
  900.       call lineout 'EAS.CMD', "    arg6 = stream(arg6,'c','query exists')"
  901.       call lineout 'EAS.CMD', "  end"
  902.       call lineout 'EAS.CMD', "end"
  903.       call lineout 'EAS.CMD', "if arg7 \= '' then "
  904.       call lineout 'EAS.CMD', "do"
  905.       call lineout 'EAS.CMD', "  if left(arg7,1,1) \= '/' then"
  906.       call lineout 'EAS.CMD', "  do"
  907.       call lineout 'EAS.CMD', "    arg7 = stream(arg7,'c','query exists')"
  908.       call lineout 'EAS.CMD', "  end"
  909.       call lineout 'EAS.CMD', "end"
  910.       call lineout 'EAS.CMD', "if arg8 \= '' then "
  911.       call lineout 'EAS.CMD', "do"
  912.       call lineout 'EAS.CMD', "  if left(arg8,1,1) \= '/' then"
  913.       call lineout 'EAS.CMD', "  do"
  914.       call lineout 'EAS.CMD', "    arg8 = stream(arg8,'c','query exists')"
  915.       call lineout 'EAS.CMD', "  end"
  916.       call lineout 'EAS.CMD', "end"
  917.       call lineout 'EAS.CMD', "if arg9 \= '' then "
  918.       call lineout 'EAS.CMD', "do"
  919.       call lineout 'EAS.CMD', "  if left(arg9,1,1) \= '/' then"
  920.       call lineout 'EAS.CMD', "  do"
  921.       call lineout 'EAS.CMD', "    arg9 = stream(arg9,'c','query exists')"
  922.       call lineout 'EAS.CMD', "  end"
  923.       call lineout 'EAS.CMD', "end"
  924.       call lineout 'EAS.CMD', "n = setlocal()"
  925.       call lineout 'EAS.CMD', "n = directory('"curdir"')"
  926.       call lineout 'EAS.CMD', "'start eas.exe 'arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  927.       call lineout 'EAS.CMD', "n = endlocal()"
  928.       call stream 'EAS.CMD','C','close'
  929.     end
  930.     else say "Couldn't create EAS.CMD file."
  931.     'del UNDEL.CMD 1>NUL 2>NUL'
  932.     dummy = stream('UNDEL.CMD','C','open')
  933.     if dummy = 'READY:' then
  934.     do
  935.       say 'Creating an UNDEL.CMD file.'
  936.       call lineout 'UNDEL.CMD', "/* UNDEL (FM/2) command file.  Locate in a directory"
  937.       call lineout 'UNDEL.CMD', " * on your PATH. */"
  938.       call lineout 'UNDEL.CMD', "'@echo off'"
  939.       call lineout 'UNDEL.CMD', "n = setlocal()"
  940.       call lineout 'UNDEL.CMD', "n = directory('"curdir"')"
  941.       call lineout 'UNDEL.CMD', "'start undel.exe %1'"
  942.       call lineout 'UNDEL.CMD', "n = endlocal()"
  943.       call stream 'UNDEL.CMD','C','close'
  944.     end
  945.     else say "Couldn't create UNDEL.CMD file."
  946.     'del KILLPROC.CMD 1>NUL 2>NUL'
  947.     dummy = stream('KILLPROC.CMD','C','open')
  948.     if dummy = 'READY:' then
  949.     do
  950.       say 'Creating a KILLPROC.CMD file.'
  951.       call lineout 'KILLPROC.CMD', "/* KILLPROC (FM/2) command file.  Locate in a directory"
  952.       call lineout 'KILLPROC.CMD', " * on your PATH. */"
  953.       call lineout 'KILLPROC.CMD', "'@echo off'"
  954.       call lineout 'KILLPROC.CMD', "n = setlocal()"
  955.       call lineout 'KILLPROC.CMD', "n = directory('"curdir"')"
  956.       call lineout 'KILLPROC.CMD', "'start killproc.exe'"
  957.       call lineout 'KILLPROC.CMD', "n = endlocal()"
  958.       call stream 'KILLPROC.CMD','C','close'
  959.     end
  960.     else say "Couldn't create KILLPROC.CMD file."
  961.     'del VIEWINFS.CMD 1>NUL 2>NUL'
  962.     dummy = stream('VIEWINFS.CMD','C','open')
  963.     if dummy = 'READY:' then
  964.     do
  965.       say 'Creating a VIEWINFS.CMD file.'
  966.       call lineout 'VIEWINFS.CMD', "/* VIEWINFS (FM/2) command file.  Locate in a directory"
  967.       call lineout 'VIEWINFS.CMD', " * on your PATH. */"
  968.       call lineout 'VIEWINFS.CMD', "'@echo off'"
  969.       call lineout 'VIEWINFS.CMD', "n = setlocal()"
  970.       call lineout 'VIEWINFS.CMD', "n = directory('"curdir"')"
  971.       call lineout 'VIEWINFS.CMD', "'start viewinfs.exe'"
  972.       call lineout 'VIEWINFS.CMD', "n = endlocal()"
  973.       call stream 'VIEWINFS.CMD','C','close'
  974.     end
  975.     else say "Couldn't create VIEWINFS.CMD file."
  976.     'del VIEWHELP.CMD 1>NUL 2>NUL'
  977.     dummy = stream('VIEWHELP.CMD','C','open')
  978.     if dummy = 'READY:' then
  979.     do
  980.       say 'Creating a VIEWHELP.CMD file.'
  981.       call lineout 'VIEWHELP.CMD', "/* VIEWHELP (FM/2) command file.  Locate in a directory"
  982.       call lineout 'VIEWHELP.CMD', " * on your PATH. */"
  983.       call lineout 'VIEWHELP.CMD', "'@echo off'"
  984.       call lineout 'VIEWHELP.CMD', "n = setlocal()"
  985.       call lineout 'VIEWHELP.CMD', "n = directory('"curdir"')"
  986.       call lineout 'VIEWHELP.CMD', "'start viewinfs.exe DUMMY'"
  987.       call lineout 'VIEWHELP.CMD', "n = endlocal()"
  988.       call stream 'VIEWHELP.CMD','C','close'
  989.     end
  990.     else say "Couldn't create VIEWHELP.CMD file."
  991.     'del GLOBAL.CMD 1>NUL 2>NUL'
  992.     dummy = stream('GLOBAL.CMD','C','open')
  993.     if dummy = 'READY:' then
  994.     do
  995.       say 'Creating a GLOBAL.CMD file.'
  996.       call lineout 'GLOBAL.CMD', "/* GLOBAL (FM/2) command file.  Locate in a directory"
  997.       call lineout 'GLOBAL.CMD', " * on your PATH. */"
  998.       call lineout 'GLOBAL.CMD', "'@echo off'"
  999.       call lineout 'GLOBAL.CMD', "arg arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  1000.       call lineout 'GLOBAL.CMD', "if arg1 \= '' then "
  1001.       call lineout 'GLOBAL.CMD', "do"
  1002.       call lineout 'GLOBAL.CMD', "  if left(arg1,1,1) \= '/' then"
  1003.       call lineout 'GLOBAL.CMD', "  do"
  1004.       call lineout 'GLOBAL.CMD', "    arg1 = stream(arg1,'c','query exists')"
  1005.       call lineout 'GLOBAL.CMD', "  end"
  1006.       call lineout 'GLOBAL.CMD', "end"
  1007.       call lineout 'GLOBAL.CMD', "else arg1 = directory()"
  1008.       call lineout 'GLOBAL.CMD', "if arg2 \= '' then "
  1009.       call lineout 'GLOBAL.CMD', "do"
  1010.       call lineout 'GLOBAL.CMD', "  if left(arg2,1,1) \= '/' then"
  1011.       call lineout 'GLOBAL.CMD', "  do"
  1012.       call lineout 'GLOBAL.CMD', "    arg2 = stream(arg2,'c','query exists')"
  1013.       call lineout 'GLOBAL.CMD', "  end"
  1014.       call lineout 'GLOBAL.CMD', "end"
  1015.       call lineout 'GLOBAL.CMD', "if arg3 \= '' then "
  1016.       call lineout 'GLOBAL.CMD', "do"
  1017.       call lineout 'GLOBAL.CMD', "  if left(arg3,1,1) \= '/' then"
  1018.       call lineout 'GLOBAL.CMD', "  do"
  1019.       call lineout 'GLOBAL.CMD', "    arg3 = stream(arg3,'c','query exists')"
  1020.       call lineout 'GLOBAL.CMD', "  end"
  1021.       call lineout 'GLOBAL.CMD', "end"
  1022.       call lineout 'GLOBAL.CMD', "if arg4 \= '' then "
  1023.       call lineout 'GLOBAL.CMD', "do"
  1024.       call lineout 'GLOBAL.CMD', "  if left(arg4,1,1) \= '/' then"
  1025.       call lineout 'GLOBAL.CMD', "  do"
  1026.       call lineout 'GLOBAL.CMD', "    arg4 = stream(arg4,'c','query exists')"
  1027.       call lineout 'GLOBAL.CMD', "  end"
  1028.       call lineout 'GLOBAL.CMD', "end"
  1029.       call lineout 'GLOBAL.CMD', "if arg5 \= '' then "
  1030.       call lineout 'GLOBAL.CMD', "do"
  1031.       call lineout 'GLOBAL.CMD', "  if left(arg5,1,1) \= '/' then"
  1032.       call lineout 'GLOBAL.CMD', "  do"
  1033.       call lineout 'GLOBAL.CMD', "    arg5 = stream(arg5,'c','query exists')"
  1034.       call lineout 'GLOBAL.CMD', "  end"
  1035.       call lineout 'GLOBAL.CMD', "end"
  1036.       call lineout 'GLOBAL.CMD', "if arg6 \= '' then "
  1037.       call lineout 'GLOBAL.CMD', "do"
  1038.       call lineout 'GLOBAL.CMD', "  if left(arg6,1,1) \= '/' then"
  1039.       call lineout 'GLOBAL.CMD', "  do"
  1040.       call lineout 'GLOBAL.CMD', "    arg6 = stream(arg6,'c','query exists')"
  1041.       call lineout 'GLOBAL.CMD', "  end"
  1042.       call lineout 'GLOBAL.CMD', "end"
  1043.       call lineout 'GLOBAL.CMD', "if arg7 \= '' then "
  1044.       call lineout 'GLOBAL.CMD', "do"
  1045.       call lineout 'GLOBAL.CMD', "  if left(arg7,1,1) \= '/' then"
  1046.       call lineout 'GLOBAL.CMD', "  do"
  1047.       call lineout 'GLOBAL.CMD', "    arg7 = stream(arg7,'c','query exists')"
  1048.       call lineout 'GLOBAL.CMD', "  end"
  1049.       call lineout 'GLOBAL.CMD', "end"
  1050.       call lineout 'GLOBAL.CMD', "if arg8 \= '' then "
  1051.       call lineout 'GLOBAL.CMD', "do"
  1052.       call lineout 'GLOBAL.CMD', "  if left(arg8,1,1) \= '/' then"
  1053.       call lineout 'GLOBAL.CMD', "  do"
  1054.       call lineout 'GLOBAL.CMD', "    arg8 = stream(arg8,'c','query exists')"
  1055.       call lineout 'GLOBAL.CMD', "  end"
  1056.       call lineout 'GLOBAL.CMD', "end"
  1057.       call lineout 'GLOBAL.CMD', "if arg9 \= '' then "
  1058.       call lineout 'GLOBAL.CMD', "do"
  1059.       call lineout 'GLOBAL.CMD', "  if left(arg9,1,1) \= '/' then"
  1060.       call lineout 'GLOBAL.CMD', "  do"
  1061.       call lineout 'GLOBAL.CMD', "    arg9 = stream(arg9,'c','query exists')"
  1062.       call lineout 'GLOBAL.CMD', "  end"
  1063.       call lineout 'GLOBAL.CMD', "end"
  1064.       call lineout 'GLOBAL.CMD', "n = setlocal()"
  1065.       call lineout 'GLOBAL.CMD', "n = directory('"curdir"')"
  1066.       call lineout 'GLOBAL.CMD', "'start global.exe' arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  1067.       call lineout 'GLOBAL.CMD', "n = endlocal()"
  1068.       call stream 'GLOBAL.CMD','C','close'
  1069.     end
  1070.     else say "Couldn't create GLOBAL.CMD file."
  1071.     say ""
  1072.     parse upper var curdir curdir
  1073.     say "Please add the directory"
  1074.     say "  "curdir"\UTILS"
  1075.     say "to your PATH in CONFIG.SYS."
  1076.     say "┌──────────────────────────────────────────────────────────────────┐"
  1077.     say "│Remember, you'll need to reboot before such a change takes effect.│"
  1078.     say "│FM/2 will run fine from its WPS objects without this change; the  │"
  1079.     say "│proposed change allows it to be run from any command line, and for│"
  1080.     say "│other programs that might want to use FM/2 as its file manager to │"
  1081.     say "│find and run it easily.                                           │"
  1082.     say "└──────────────────────────────────────────────────────────────────┘"
  1083.     say "While you're in there, check your LIBPATH statement for a '.\' entry..."
  1084.     if existed \= "TRUE" then
  1085.     do
  1086.       say ""
  1087.       /* remove next 6 lines for unattended use */
  1088.       call charout ,'  Press [Enter] for more...'
  1089.       dummy = ''
  1090.       do until dummy = '0d'x
  1091.         dummy = SysGetKey('NOECHO')
  1092.       end
  1093.       call charout ,'0d1b'x'[K'
  1094.       rc = stream('fatopt.exe','c','query exists')
  1095.       say   "┌────────────────────────────────────────────────────────────────┐"
  1096.       if rc = '' then
  1097.       do
  1098.         say "│I suggest that you place the utilities from the FM/2 Utilities  │"
  1099.         say "│archive in this directory, also, in which case you should       │"
  1100.         say "│_definitely_ make the change to PATH so that FM/2 can find them.│"
  1101.       end
  1102.       say   "│You may want to tweak the command lines in the .CMD files I just│"
  1103.       say   "│built and/or those in the WPS objects in the FM/2 folder for    │"
  1104.       say   "│desired specific behaviors.  The READ.ME file will tell you how.│"
  1105.       say   "└────────────────────────────────────────────────────────────────┘"
  1106.     end
  1107.     if existed = 'TRUE' then
  1108.     do
  1109.       say ''
  1110.       say "If you have previously altered your CONFIG.SYS's PATH statement"
  1111.       say 'as instructed above, please ignore this rambling.'
  1112.     end
  1113.     say ""
  1114.     /* remove next 6 lines for unattended use */
  1115.     call charout ,'  Press [Enter] to continue...'
  1116.     dummy = ''
  1117.     do until dummy = '0d'x
  1118.       dummy = SysGetKey('NOECHO')
  1119.     end
  1120.     call charout ,'0d1b'x'[K'
  1121.   end
  1122.   else say "Couldn't create FM2.CMD file.  Panic."
  1123.   dummy = directory(curdir)
  1124. end
  1125. else say "Couldn't switch to "curdir"\utils"
  1126.  
  1127. /* type the install.dat file to show any critical info/notices */
  1128.  
  1129. /* NOTE:  remove following 8 lines for unattended use... */
  1130. rc = stream('install.dat','c','query exists')
  1131. if rc \= '' then
  1132. do
  1133.   'type install.dat'
  1134.   'DEL INSTALL.DAT 1>NUL 2>NUL'
  1135.   /* remove next 6 lines for unattended use */
  1136.   call charout ,'  Press [Enter] to continue...'
  1137.   dummy = ''
  1138.   do until dummy = '0d'x
  1139.     dummy = SysGetKey('NOECHO')
  1140.   end
  1141.   call charout ,'0d1b'x'[K'
  1142. end
  1143.  
  1144. /* Final words */
  1145.  
  1146. say '┌──────────────────────────────────────────────────────────────────────────┐'
  1147. say '│To move FM/2 to another directory, move the files, delete the FM/2 folder,│'
  1148. say '│then rerun INSTALL.  There is no need to "uninstall" to move FM/2.        │'
  1149. say '│                                                                          │'
  1150. say '│To remove FM/2 completely, run UNINSTAL and follow its directions.        │'
  1151. say '└──────────────────────────────────────────────────────────────────────────┘'
  1152. say "I'm done now."
  1153. say ''
  1154.  
  1155.